import { Component, OnInit } from '@angular/core';
import { productdataService, product } from '../shared/productdata.service';
// import { AnotherProductdataService } from '../shared/another-productdata.service';

@Component({
  selector: 'app-product1',
  templateUrl: './product1.component.html',
  styleUrls: ['./product1.component.css'],
  // providers:[{
  //   provide:productdataService,useClass:AnotherProductdataService
  // }]
})
export class Product1Component implements OnInit {

  product:product;
  constructor(public productDataService:productdataService) { }

  ngOnInit() {
    this.product = this.productDataService.getProduct();
  }

}
